package com.etc.service;

import java.util.ArrayList;

import com.etc.dao.CounterDAO;
import com.etc.entity.Counter;

public class CounterService {

	CounterDAO counterDao = new CounterDAO();
	
	public ArrayList<Counter> findAllCounter() {
		return counterDao.findAllCounter();
	}
	//添加一个用户
	public void addCounter(String userIdReg, String passwordReg) {
		Counter counter = new Counter(userIdReg, passwordReg, null);
		counterDao.addCounter(counter);
	}
	
	//测试
	public static void main(String[] args) {
		CounterService counterService = new CounterService();
		ArrayList<Counter> findAllCounter = counterService.findAllCounter();
		for (Counter counter : findAllCounter) {
			System.out.println(counter.toString());
		}
	}
}
